<?php
declare (strict_types=1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;
use app\traits\ModelTrait;

/**
 * 商品
 * Class Goods
 * @package app\model
 */
class Goods extends BaseModel
{
    public static $_table = "goods";

    use SoftDelete;
    //时间字段显示格式
    protected $dateFormat = 'Y-m-d H:i:s';
    // 开启自动写入时间戳字段
    //protected $autoWriteTimestamp = 'datetime';
    //软删除时间
    protected $deleteTime = false;
    //软删除字段的默认值
    protected $defaultSoftDelete = 0;
    //只读字段，不允许被更改
    protected $readonly = [];
    //数据输出隐藏的属性
//    protected $hidden = ['user_id'];
    protected $pk = 'id';
    // 设置当前模型对应的完整数据表名称
    protected $table = 'goods';
    //据输出显示的属性
    //public static $showField = ['id','account', 'user_name', 'parent_id', 'password', 'role', 'enable', 'create_time'];
    // 号卡
    const GOODS_TYPE_HK = 0;
    // 流量包
    const GOODS_TYPE_LLB = 1;
    // 靓号
    const GOODS_TYPE_LH = 2;
    // 宽带
    const GOODS_TYPE_KD = 3;

    const GOODS_TEXT_ARR = [
        self::GOODS_TYPE_HK => '号卡',
        self::GOODS_TYPE_LLB => '流量包',
        self::GOODS_TYPE_LH => '靓号',
        self::GOODS_TYPE_KD => '宽带',
    ];
    use ModelTrait;
}

